home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1987 May / 1987-05.d64 / date_time loader (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  982b  |  31 lines

  1. 10 rem speedscript date/time boot program
  2. 20 a$="speedscript date"
  3. 30 if a=0 then a=1:print"[147][151]loading..."a$:load a$,8,1
  4. 40 print chr$(147) spc(131) a$
  5. 50 ml=51451:cl=51823:u$=chr$(145)+chr$(145)
  6. 60 print spc(85)"set the date (mn/dt/yr)":print
  7. 70 input"month  (1-12)     [157][157][157][157][157]";mn
  8. 80 if mn<1 or mn>12 then print u$:goto70
  9. 90 input" date  (1-31)     [157][157][157][157][157]";dt
  10. 100 if dt<1 or dt>31 then print u$:goto90
  11. 110 input" year (86-99)     [157][157][157][157][157]";yr
  12. 120 if yr<86 or yr>99 then print u$:goto110
  13. 130 print spc(85)"set the time (hr/ms/am-pm)":print
  14. 140 input"hours  (1-12)     [157][157][157][157][157]";hr
  15. 150 if hr<1 or hr>12 then print u$:goto140
  16. 160 input" mins  (0-59)     [157][157][157][157][157]";ms
  17. 170 if ms >59 then print u$:goto160
  18. 180 input"am-pm   (a/p)     [157][157][157][157][157]";p$
  19. 190 if p$ <>"a" and p$<>"p"then print u$:goto180
  20. 200 flag=128:if p$="a"and hr<12 then flag=0
  21. 210 if p$="p"and hr=12 then flag=0
  22. 220 by=hr:gosub300:hr=by or flag
  23. 230 by=ms:gosub300:ms=by
  24. 240 poke cl,ms:poke cl+1,hr:poke cl+2,mn
  25. 250 poke cl+3,dt:poke cl+4,yr
  26. 260 print:print"put speedscript disk in drive 0, unit 8"
  27. 270 print" - when ready, press return.":sys 65487:sys ml
  28. 280 poke 52578,240:poke 52579,20
  29. 290 end
  30. 300 x=int(by/10):y=by-10*x:by=16*x+y:return
  31.